package com.aurora.app.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.aurora.app.dao.WeixinUserTokenDao;
import com.aurora.app.entity.WeixinUserToken;
import com.aurora.base.dao.BaseDao;
import com.aurora.base.service.BaseService;

@Service
public class WeixinUserTokenService extends BaseService<WeixinUserToken> {

	@Resource
	private WeixinUserTokenDao baseDao;
	@Override
	public BaseDao<WeixinUserToken> getBaseDao() {
		// TODO Auto-generated method stub
		return this.baseDao;
	}
	@Transactional
	public WeixinUserToken findByOpenId(String openid) {
		System.out.println("openid"+openid);
		return this.baseDao.find("o.user.openid = ? and o.isDelete = 0", openid);
	}

}
